import pygame

class sfx():
	
	def __init__(self,data_path):
		
		self.sounds = {'step': pygame.mixer.Sound(data_path + 'step.ogg'),
						'dead': pygame.mixer.Sound(data_path + 'dead.ogg'),
						'got': pygame.mixer.Sound(data_path + 'got.ogg'),
						'activate': pygame.mixer.Sound(data_path + 'activate.ogg'),
						'heal': pygame.mixer.Sound(data_path + 'heal.ogg'),
						'hit': pygame.mixer.Sound(data_path + 'hit.ogg'),
						'beep': pygame.mixer.Sound(data_path + 'beep.ogg'),
						'door': pygame.mixer.Sound(data_path + 'door.ogg'),
						'tp': pygame.mixer.Sound(data_path + 'tp.ogg'),
						'loose': pygame.mixer.Sound(data_path + 'loose.ogg'),
						'win': pygame.mixer.Sound(data_path + 'win.ogg')}
		
	def play_sound(self,sound):
		#pygame.mixer.Sound.stop()
		try:
			self.sounds[sound].play()
		except:
			print('SFX error')
